/**
 * 
 */
package com.globallogic.training.university;

/**
 * <code>WeekDay</code> enumeration represents workable week days
 * @author vasiliy.kulgaviy
 *
 */
public enum WeekDay {
    MONDAY, TUESDAY, WEDNESDAY,
    THURSDAY, FRIDAY;
    
    /**
     * Converts a week day to integer
     * @param weekDay Week Day to convert
     * @return integer representation of the week day
     */
    public static int getIntValue (WeekDay weekDay) {
    	switch(weekDay) {
    	case MONDAY:
    		return 1;
    		
    	case TUESDAY:
    		return 2;
    		
    	case WEDNESDAY:
    		return 3;
    		
    	case THURSDAY:
    		return 4;
    		
    	case FRIDAY:
    		/* Walk though */
    	default:
    		return 5;
    	}
    }
    
    /**
     * Converts an integer number to Week Day
     * @param day - number to convert
     * @return - WeekDay representation of the number
     */
    public static WeekDay getValue (int day) {
    	switch(day) {
    	case 1:
    		return MONDAY;
    		
    	case 2:
    		return TUESDAY;
    		
    	case 3:
    		return WEDNESDAY;
    		
    	case 4:
    		return THURSDAY;
    		
    	case 5:
    		/* Walk though */
    	default:
    		return FRIDAY;
    	}
    }
}
